package permissions

import (
	"context"
	"goAdminV1/internal/model"
	"goAdminV1/utility"

	"goAdminV1/api/permissions/v1"
)

func (c *ControllerV1) PermissionDetail(ctx context.Context, req *v1.PermissionDetailReq) (res *v1.PermissionDetailRes, err error) {
	// 调用模型层获取权限列表
	data, err := model.GetPermissionDetailById(ctx, req.Id)
	if err != nil {
		return nil, utility.Error(utility.CodeOperation, err)
	}
	return data, nil
}
